<template>
  <div>
    <navbar class="nav-bar">
      <template v-slot:center>
        <div style="font-size: .5267rem;">king商城</div>
      </template>
    </navbar>

    <!-- 头像 -->
    <div id="user-info">
      <a href="#" class="clear-fix">
        <slot name="user-icon">
          <img class="privateImage-svg left" src="../../assets/image/home/1.jpg" />
        </slot>

        <div class="login-info left">
          <div class="t flex-start">
            <van-icon name="manager"/>
            <span style="margin-left: .2667rem;">库里</span>
          </div>
          <div class="phone">
            <div class="t flex-start">
              <van-icon name="phone" />
             <span style="margin-left: .2667rem;">13044206587</span>
            </div>
          </div>
          <div class="t flex-start" style="margin-top: .1667rem;">
            <van-icon name="location" />
            <span style="margin-left: .2667rem;">广东 广州</span>
          </div>
          <div class="dl" @click="denglu1">
            <slot>登录/注册</slot>
          </div>
        </div>
      </a>
    </div>

    <!-- 下方 -->
    <section class="account">
      <div class="account-item">
        <div class="number">
          <span class="balance">{{data.money}}</span>元
        </div>
        <div class="account-info">我的余额</div>
      </div>
      <div class="account-item">
        <div class="number">
          <span class="balance">15</span>个
        </div>
        <div class="account-info">我的优惠</div>
      </div>
      <div class="account-item">
        <div class="number">
          <span class="balance">1452</span>分
        </div>
        <div class="account-info">我的积分</div>
      </div>
    </section>

    <!-- 个人列表 -->
    <profilelist />



  </div>
</template>

<script setup>
import { reactive,provide,inject } from 'vue'
import navbar from '../../components/navbar.vue'
import profilelist from '../../components/profilelist.vue'
import { useStore } from 'vuex' 
const store = useStore() 

let data = reactive({
   money:0
})
data.money=store.getters.getaccount
data.buymoney=store.getters.getbuymoney
console.log('buymoney',data.buymoney);

data.money=data.money-data.buymoney
store.commit('updataaccount',data.money)

store.commit('initbuymoney')




</script>

<style scoped>
#profile {
  background-color: #f2f2f2;
}

.nav-bar {
  background-color: var(--color-tint);
  font-weight: 700;
  color: #fff;
}

.account {
  display: flex;
}

.account-item {
  width: 100%;
  background-color: #fff;
  margin-right: 1px;
  text-align: center;
}

.account-item:last-of-type {
  margin-right: 0;
}

.account-item {
  color: #666;
  font-size: 13px;
  padding: 18px;
}

.account-item .balance {
  font-size: 24px;
  font-weight: 700;
  color: #ff5f3e;
}

.account-info {
  margin-top: 6px;
}

.order-list,
.service-list {
  margin-top: 12px;
}

.t {
  font-size: 20px;
}

.dl {
  margin-top: 30px;
  font-size: 20px;
  margin-left: 80px;
}

#user-info {
  background-color: var(--color-tint);
  padding: 15px;
  margin-top: -5px;
}

#user-info .privateImage-svg {
  width: 60px;
  height: 60px;
  background-color: #fff;
  border-radius: 30px;
}

.left {
  float: left;
}

#user-info .arrow-svg {
  width: 11px;
  height: 22px;
  margin-top: 18px;
}

#user-info .login-info {
  color: #fff;
  margin: 10px 0 0 10px;
}

#user-info .login-info .phone {
  position: relative;

  font-size: 13px;
  margin-top: 5px;
  font-weight: 300;
}

#user-info .login-info .phone .icon-mobile {
  position: absolute;
  width: 12px;
  height: 18px;
  left: -15px;
  top: 0px;
}
</style>